﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using Bigger.Core.Service;
using Bigger.Core.Logging;

namespace Bigger.Study.ConsoleApp
{
    public class BiggerLoggingExample : IExample
    {
        public void Execute()
        {
            Register();
            ILogService objLogService = LogConfiguration.LogServiceProvider.CreateLogService();
            for (int i = 0; i < 100; i++)
            {
                LogInfo objLogInfo = new LogInfo();
                objLogInfo.LogTitle = "***标题***" + i;
                objLogInfo.LogContent = "***内容***" + i;
                objLogInfo.LoggerLevel = LoggerLevel.Error;
                objLogService.WriteLog(objLogInfo);
                Thread.Sleep(5000);
            }
            //objLogService.WriteLog("***标题***", "***内容***");
        }
        void Register()
        {
            //初始化服务
            UnityConfiguration.UnityConfig.InitialConfig();
        }
    }
}
